Conditions | 5 |
Paths | 8 |
Total Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | export default optionsFromStrings; |
||
4 | function optionsFromStrings(options){ |
||
5 | var intOptions = [ |
||
6 | "width", |
||
7 | "height", |
||
8 | "textMargin", |
||
9 | "fontSize", |
||
10 | "margin", |
||
11 | "marginTop", |
||
12 | "marginBottom", |
||
13 | "marginLeft", |
||
14 | "marginRight" |
||
15 | ]; |
||
16 | |||
17 | for(var intOption in intOptions){ |
||
18 | if(intOptions.hasOwnProperty(intOption)){ |
||
19 | intOption = intOptions[intOption]; |
||
20 | if(typeof options[intOption] === "string"){ |
||
21 | options[intOption] = parseInt(options[intOption], 10); |
||
22 | } |
||
23 | } |
||
24 | } |
||
25 | |||
26 | if(typeof options["displayValue"] === "string"){ |
||
27 | options["displayValue"] = (options["displayValue"] != "false"); |
||
28 | } |
||
29 | |||
30 | return options; |
||
31 | } |
||
32 |